{template 'common/header'}
<link href="{MODULE_URL}template/web/css/classlist.css" rel="stylesheet" type="text/css">
<div class="list_th">
    <div class="td" style=" width:25%;">
        <div class="left_padding">技师姓名</div>
    </div>  
    <div class="td text-center" style=" width:10%;">技师等级</div>
    <div class="td text-center" style=" width:15%;">工作时间</div>
      <div class="td text-center" style=" width:10%;">好评率</div>
    <div class="td text-center" style=" width:10%;">受赞次数</div>
    <div class="td text-center" style=" width:30%;">
        <div class="list_right text-center">操作</div>
    </div>
    <div class="clear"></div>
</div>
{if $tech}
{loop $tech $k $o}
<div class="list_tr link_bk">
        <div class="td text-center" style=" width:25%;">
            <div class="category_img J_show" id="{$o['id']}" level="1"></div>
            <div class="category_input">
                <input name="save_id[]" type="hidden" value="{$o['id']}"/>
                <input name="categoryname[]" type="text" class="input_text_default small" maxlength="20"
                       value="{$o['tname']}" style=" width: 120px;"/>
                <span style="color:#999999; margin-left: 5px; font-size: 13px;">[id:{$o['id']}]</span>
            </div>
            <div class="clear"></div>
        </div>
        <div class="td text-center" style=" width:10%;" >
            {$o['leve']}
        </div>     
        <div class="td text-center" style=" width:15%;" >
            {$o['onlinestart']}-{$o['onlineend']}
        </div>  
        <div class="td text-center" style=" width:10%;" >
            {$o['praise']}%
        </div>            
        <div class="td text-center" style=" width:10%;" >
            {$o['fabulous']}
        </div>             
        <div class="td edit text-center" style=" width:30%;">
            <div class="list_right btn">
                <a href="{php echo $this->createWebUrl('techedit',array('oid'=>$o['id']));}">修改</a>
                <a class="gray delete" did="{$o['id']}">删除</a>
                <a class="green hide_{$o['status']} ishide" did="{$o['id']}" sid="{$o['status']}">是否上线</a>
            </div>
        </div>
        <div class="clear"></div>
</div>
{/loop}
{/if}
<div class="list_tr">
    <div class="td" style="width: 60%;">
        <a class="J_add category_list_add" level="1" pid="0" href="{php echo $this->createWebUrl('techadd');}">添加技师</a>
        <div class="clear"></div>
    </div>
</div>
<div class="list_tr">    
<div class="text-center">
  {php echo $pager;}
</div> 
</div>
<style type="text/css">.right-content{padding: 0;}.hot_1{background-color: red;}</style>
<link rel="stylesheet" href="{MODULE_URL}public/css/Toast.css">
<script src="{MODULE_URL}public/js/Toast.js"></script>  
<script type="text/javascript">
$(document).ready(function(){
    $(document).on('click','.delete', function () {
              if(!confirm("确定要删除该技师吗！")){                
                   window.event.returnValue=false;
               }else{
                   $.ajax({
                       url:"{php echo $this->createWebUrl('techdel');}&version_id="+"{$_GPC['version_id']}",
                       data:{did:$(this).attr('did')},
                       dataType:"json",
                       type:"post",
                      success:function(res){
                         if(res.status== 1){
                             mqToast({type:1,context: res.msg}); 
                             setTimeout(function(){
                                window.location.reload(); 
                              },2000);
                            
                             return false;
                         }else{
                             mqToast({type:1,context: res.msg});    
                             return false;
                         }
                      }
                    })                    
               }        
    });   
    //上线设置
    $(document).on('click','.ishide',function(){
            var ssid = $(this).attr('sid');
            var obj  = $(this);
           $.ajax({
                     url:"{php echo $this->createWebUrl('techstatus');}",
                     data:{did:$(this).attr('did'),sid:$(this).attr('sid')},
                     dataType:"json",
                     type:"post",
                    success:function(res){
                       if(res.status== 1){  
                           if(ssid=='1'){   
                            obj.addClass('hide_0');
                            obj.attr('sid','0'); 
                           }else{                           
                            obj.removeClass('hide_0');
                            obj.attr('sid','1');
                           }
                            mqToast({type:1,context: res.msg}); 
                            return false;
                       }else{
                           mqToast({type:1,context: res.msg}); 
                           return false;
                       }
                    }
                  });
    });
  });
</script>

{template 'common/footer'}